package datastructure;

/**
 * Author: Jason Wu
 * Date  : 2013-12-02
 */
public class EnqueueThread implements Runnable {
    private BlockingQueue blockingQueue;

    public EnqueueThread(BlockingQueue blockingQueue) {
        this.blockingQueue = blockingQueue;
    }

    @Override
    public void run() {
        try {
            for (int i = 0; i < 20; i++) {
                blockingQueue.enqueue(new PushTask(i));
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
